package lenovo.asd.xml;

import java.io.InputStream;
import java.util.List;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

public class WifiSAXService {
	// me: change Task to WifiTask
	public static List<WifiTask> readXml(InputStream inStream) throws Exception {
		SAXParserFactory spf = SAXParserFactory.newInstance();
		SAXParser saxParser = spf.newSAXParser();
		// me: WifiXMLContentHandler
		WifiXMLContentHandler handler = new WifiXMLContentHandler();

		saxParser.parse(inStream, handler);
		inStream.close();
		
		// me: getWifiTasks
		return handler.getWifiTasks();
	}
}
